package com.uchedao.seller.ui.carlist;


import com.uchedao.seller.module.car.CarBrand;
import com.uchedao.seller.ui.carlist.entity.BrandEntity;

import java.util.Comparator;

/**
 * 排序
 *
 */

public class PinyinComparator implements Comparator<BrandEntity> {

	public int compare(CarBrand o1, CarBrand o2) {
		if ((o1.getSpell().charAt(0)+"").equals("@")
				|| (o2.getSpell().charAt(0)+"").equals("#")) {
			return -1;
		} else if ((o1.getSpell().charAt(0)+"").equals("#")
				|| (o2.getSpell().charAt(0)+"").equals("@")) {
			return 1;
		} else {
			return (o1.getSpell().charAt(0)+"").compareTo((o2.getSpell().charAt(0)+""));
		}
	}

	@Override
	public int compare(BrandEntity lhs, BrandEntity rhs) {
		return 0;
	}
}
